<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:t="http://myfaces.apache.org/tomahawk">
<h:head>
	<title></title>
	<h:outputStylesheet library="css" name="style.css" />
</h:head>
<h:body>
	<ui:include src="header.xhtml" />
	<c:if test="${userlogin !=null}">
	
		<div id="backContent"  style="border: 1px transparent solid" >
			<div class="backgr">
				<ui:include src="bg.xhtml" />
			</div>
			<div id="content" style="height:450px;">
				<div style="height: 250px; float: left;">
					<h:form>
						<h:graphicImage id="image" alt="Change avatar"
							url="#{personalPageBean.avatarPath}" style="height: 250px;">
						</h:graphicImage>
					</h:form>

				</div>

				<h:form>
					<h:panelGrid columns="2" rowClasses="firstRow, secondRow"
						width="300" class="user_info">
						<h:outputLabel value="Name" for="name" />
						<h:inputText id="name" value="#{loginBean.user.name}"
							required="true" />

						<h:outputLabel value="City" for="city" />
						<h:inputText id="city" value="#{loginBean.user.city}"
							required="true" />

						<h:outputLabel value="Sex" for="sex" />
						<h:selectOneMenu id="sex" value="#{loginBean.user.sex}"
							required="true">
							<f:selectItem itemValue="male" itemLabel="Male" />
							<f:selectItem itemValue="female" itemLabel="Female" />
						</h:selectOneMenu>

						<h:outputLabel value="About you" for="userInfo" />
						<h:inputTextarea id="userInfo" value="#{loginBean.user.userInfo}"
							cols="30" rows="10" required="true" />

						<h:commandButton value="edit" action="#{loginBean.updateUser}" />
					</h:panelGrid>

				</h:form>


				<div
					style="border-width: 1px 0 1px 0; border-color: black; border-style: solid; width: 280px; padding-top: 70px;">
					<h:form id="uploadForm" enctype="multipart/form-data"
						storage="file">
						<h:panelGrid columns="3" rowClasses="firstRow, secondRow">
							<h:outputLabel for="file" value="Select file" />
							<t:inputFileUpload id="file"
								value="#{personalPageBean.uploadedFile}" required="true" />
							<h:message for="uploadForm" infoStyle="color: green;"
								errorStyle="color: red;" />
						</h:panelGrid>
						<h:commandButton value="Upload"
							action="#{personalPageBean.submit}" />
					</h:form>
				</div>
			</div>
		</div>
	</c:if>
</h:body>
</html>
